In recent years, communication modes in a wireless LAN (Local Area Network) (IEEE (The Institute of Electric and Electronics Engineers) 802.11a/b/g/n/ac) have been diversified. For example, the following communication modes are provided:                ad-hoc mode,        STA mode (infrastructure mode),        AP mode (infrastructure mode),        Wi-Fi direct mode,        WiGig (Wireless Gigabit) mode, and        NAN (Neighborhood Area Network) mode.        
For example, a device, such as a PC or a smart phone, equipped with a wireless communication device having a wireless communication function for wireless LAN supports a plurality of communication modes.
Therefore, by selecting a communication mode corresponding to a service which the user desires the device to perform from among the plurality of communication modes and setting the selected communication mode to the wireless communication device, and causing the wireless communication device to carry out wireless communications with another wireless communication device in this communication mode, the device, such as a PC or a smart phone, executes an application which provides the above-mentioned service.
Encryption methods for wireless LAN include a WEP (Wired Equivalent Privacy) method, a WAPI (Wireless lan Authentication and Privacy Infrastructure) method, a WPA (Wi-Fi Protected Access) method, and a WPA2 method.
Further, the WPA method includes a WPA-Personal method using an encryption key PSK (Pre Shared Key) which is a prior common key, and a WPA-Enterprise method using IEEE802.11x authentication, and the WPA2 method includes a WPA2-Personal method using an encryption key PSK (Pre Shared Key) which is a prior common key, and a WPA2-Enterprise method using IEEE802.11x authentication.
In the WEP method, a character string (WEP key) inputted by the user is set as an encryption key, and communication data is encrypted by using the encryption key.
In the WPA-Personal method and the WPA2-Personal method, a PMK (Pairwise Master Key) which is an encryption key for creating an encryption key PSK, and an encryption key GTK (Group Transient Key) used for broadcasting or multicasting is created.
In the following patent literature 1, a technique of facilitating a connecting process when the communication mode is changed from an ad-hoc mode to an infrastructure mode is described.
Further, the following patent literature 2 proposes a method of, because in a WiGig mode for millimeter wave communications, there is a case in which the role (STA or PCP) of a wireless communication device is not fixed and changes before and after the completion of a key exchange using WPS (Wi-Fi Protected Setup), and exchanged keys cannot be used, mutually exchanging keys in advance, thereby making it possible to establish a connection even if the role of the wireless communication device changes before and after the completion of the key exchange using WPS.
Further, the following patent literatures 3 proposes a method of promptly changing from a communication mode in which to operate using a Wi-Fi method (802.11n) to a communication mode in which to operate using a WiGig method.
According to this method, by performing an authentication and key delivery process for the WiGig method by using the Wi-Fi method in advance between wireless communication devices connected to each other using the Wi-Fi method, an authentication and key delivery process at the time of establishing a connection by using the WiGig method can be eliminated.